package eu.runelord.programmers.java.boxlayouttutorial;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;

class BoxLayoutExample extends JFrame {

	private static final long serialVersionUID = 5542988826027886015L;

	public static void main(String[] args) {
		BoxLayoutExample boxLayoutExample = new BoxLayoutExample();
		boxLayoutExample.setVisible(true);
	}
	
	public BoxLayoutExample() {
		init();
	}
	
	private void init() {
		BoxLayout boxLayout = new BoxLayout(this.getContentPane(),BoxLayout.X_AXIS);
		JButton n = new JButton("NORTH"), s = new JButton("SOUTH"), w = new JButton(
				"WEST"), e = new JButton("EAST"), c = new JButton("CENTER");
		setLayout(boxLayout);
		setTitle("Przykład BorderLayout");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		add(n);
		add(s);
		add(w);
		add(e);
		add(c);
		pack();		
	}
}
